package com.kefu.z.intermediator.system;

import java.util.Map;

import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor;

/**
 * 握手（handshake）接口
 * 
 * @author Halo
 *
 */
public class SystemHttpSessionHandshakeInterceptor extends HttpSessionHandshakeInterceptor {
	
	/**
	 * 开始握手事件,创建会话
	 * 
	 */
	public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler,
			Map<String, Object> attributes) throws Exception {
		return super.beforeHandshake(request, response, wsHandler, attributes);
	}
	
	/**
	 * 关闭握手事件,结束会话
	 */
	public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler,
			Exception ex) {
		super.afterHandshake(request, response, wsHandler, ex);
	}
	
}
